/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.shibun.spricanvas;
import java.util.*;

/**
 *
 * @author awniemel
 */
public class SpriteImageGridStack {
    /** The stack is ordered 0=bottom, length=top */
    private ArrayList<SpriteImageGrid> gridStack;
    private int gridWidth;
    private int gridHeight;
    
    public SpriteImageGridStack(int gridWidth, int gridHeight) {
        if(gridWidth < 1 || gridHeight < 1) {
            throw new IllegalArgumentException("Tried to create a "+
                    "SpriteImageGridStack with a width or height of < 1");
        }
        this.gridStack = new ArrayList<SpriteImageGrid>();
        this.gridWidth = gridWidth;
        this.gridHeight = gridHeight;
        SpriteImageGrid initialLayer = new SpriteImageGrid(gridWidth, gridHeight);
        initialLayer.setLayerName("Default Layer");
        this.gridStack.add(initialLayer);
    }
    
    public SpritePixel visiblePixelAt(int x, int y) {
        if(x < 0 || x >= this.gridWidth || y < 0 || y >= this.gridHeight) {
            throw new IndexOutOfBoundsException("Tried to access a pixel "+
                    "outside the image grid");
        }
        return null;
    }
    
}
